package com.lagou.controller;

import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 123
 * @date 2020/4/15 14:05
 * @description
 */
@Controller
public class ArticleController {


    @Autowired
    private ArticleService articleService;


    @RequestMapping("index")
    public String index(Model model, @RequestParam(value = "pageNum", defaultValue = "0") int pageNum, @RequestParam(value = "pageSize", defaultValue = "2") int pageSize){
        model.addAttribute("page",articleService.findAll(pageNum,pageSize));
        return "client/index";

    }
}
